import {useAction} from '@/request/service'
export const useLogin = (onSuccess,onError)=>{
    return useAction({url:'/security/user/login',method:'POST'},{
        onSuccess:(data)=>{
            onSuccess && onSuccess(data)
        },
        onError:()=>{
            onError && onError()
        }
    },(payload)=>{
        return {params:payload,data:{}}
    })
}
export const useLogout = (onSuccess,onError)=>{
    return useAction({url:'/security/user/logout',method:'POST'},{
        onSuccess:(data)=>{
            onSuccess && onSuccess(data)
        },
        onError:()=>{
            onError && onError()
        }
    })
}